package com.tencent.wxcloudrun.service;

import com.alibaba.fastjson.JSONObject;
import com.tencent.wxcloudrun.entity.UserAllInfo;
import com.tencent.wxcloudrun.entity.UserInfo;
import com.tencent.wxcloudrun.entity.UserInfoInformation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserService {
    List<UserAllInfo> getUserList() throws Exception;

    //获取用户手机号
    //accessToken 后台唯一编码
    //code 用户code
    JSONObject getUserPhone(String code) throws Exception;

    //用户登录
    JSONObject userLogin(String code) throws Exception;

    //录入用户session以及code
    int insertUserSessionKey(UserInfo userInfo) throws Exception;

    //查询数据库内是否有此用户手机号
    int queryUserPhone(String userPhone) throws Exception;

    //更新用户的sessionkey和code
    int updateUserSessionAndCode(UserInfo userInfo) throws Exception;

    //使用手机号获得该用户的其他信息
    UserAllInfo getUser(String phone) throws Exception;

    //根据userInfoId将用户其他信息保存
    int insertUserInfo(UserInfoInformation userInfoInformation) throws Exception;

    //获取该用户的id
    int getUserId(String phoneNumber) throws Exception;

    //查询userinfoinformation表中是否含有此uid
    int queryUserInfoInformationUid(int uid) throws Exception;

    //更新用户详细信息表
    int updateUserInformation(UserInfoInformation userInfoInformation) throws Exception;
}
